]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
tests: Fix gnome-shell theme import
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 21 Feb 2018 12:01:56 +0000 (13:01 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 21 Feb 2018 13:30:00 +0000 (14:30 +0100)
The current import rule fails in two ways:
 - commit c62e7a6a moved the theme's stylesheet to the builddir
 - since commit 49c4ba56, assets are addressed as resource:// URIs

Fix both issues by loading and referencing the theme resource instead
of the stylesheet itself.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/38

tests/run-test.sh.in
tests/testcommon/test.css
tests/testcommon/ui.js

index 71b35aca0f4ea06ded218a0cfac944f5fd7d10ad..ea6d1572614bf4bec55a56f785bbebb1be4d58de 100755 (executable)
@@ -36,7 +36,7 @@ GJS_DEBUG_OUTPUT=stderr
 $verbose || GJS_DEBUG_TOPICS="JS ERROR;JS LOG"
 GNOME_SHELL_TESTSDIR="$srcdir/"
 GNOME_SHELL_JS="$srcdir/../js"
-GNOME_SHELL_DATADIR="$srcdir/../data"
+GNOME_SHELL_DATADIR="$builddir/../data"
 
 export GI_TYPELIB_PATH GJS_PATH GJS_DEBUG_OUTPUT GJS_DEBUG_TOPICS GNOME_SHELL_TESTSDIR GNOME_SHELL_JS GNOME_SHELL_DATADIR LD_PRELOAD
 
index a181c8a997467e38d102a7bf406ae457be59b17b..b82d2309b8414ff9ed811e4aca6a1d54cf85863e 100644 (file)
@@ -1,4 +1,4 @@
-@import "../../data/theme/gnome-shell.css";
+@import url("resource:///org/gnome/shell/theme/gnome-shell.css");
 
 stage {
     font: 16pt serif;
index 51c136a399b7aef64a0b1d0a7c8ad5cbc366d512..df2655feb8900138b13cdaa78df735808c241114 100644 (file)
@@ -14,6 +14,9 @@ const Environment = imports.ui.environment;
 
 function init(stage) {
     Environment.init();
+    let themeResource = Gio.Resource.load(global.datadir + '/gnome-shell-theme.gresource');
+    themeResource._register();
+
     let context = St.ThemeContext.get_for_stage(stage);
     let stylesheetPath = GLib.getenv("GNOME_SHELL_TESTSDIR") + "/testcommon/test.css";
     let theme = new St.Theme({ application_stylesheet: Gio.File.new_for_path(stylesheetPath) });